blob: 816e2763e0bc7884ca6562cae876c74824e79172 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<script context="module" lang="ts">
export type ProductsModel = {
products: ProductModel[];
};
export type ProductModel = {
title: string;
duration: string;
cost: string;
description: string;
orderLink: string;
};
</script>
<script lang="ts">
import CardV4 from "$components/card-v4.svelte";
export let model: ProductsModel;
let visible = true;
$: if (!model.products || !model.products.length) {
visible = false;
} else {
visible = true;
}
</script>
{#if visible}
<div class="wrapper">
{#each model.products as product}
<CardV4 description={product.description} title={product.title} />
{/each}
</div>
{/if}
<style lang="postcss">
.wrapper {
display: grid;
grid-template-columns: repeat(50%);
}
</style>
|